<?php
if(!function_exists("json_encode"))
{
    require_once("../utl/Services_JSON.php");

    function json_encode($val)
    {
        $json = new Services_JSON();
        return $json->encode($val);
    }

    function json_decode($val, $asAssoc = FALSE)
    {
        if($asAssoc) {
            $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
        } else {
            $json = new Services_JSON();
        }
        return $json->decode($val);
    }
}
?>
